﻿/**********************************************************************/
/*                                                                    */
/*                   embDocumentInhalator                             */
/*             http://embdocumentinhalator.codeplex.com/              */
/*                                                                    */
/*               (c) Copyright 2010 Ilija Injac         .             */
/*                                                                    */
/*  This source is subject to the CDDL License                        */
/*  http://embdocumentinhalator.codeplex.com/license                  */
/*                                                                    */
/*                                                                    */
/**********************************************************************/
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace embScannerProxy
{
    /// <summary>
    /// Serialization utilities class.
    /// </summary>
    /// This element was inserted by injac on machine PLATINCHECKER.
    /// 29.01.2011,20:54
    public class SerializationUtilities
    {

        /// <summary>
        /// Strings to byte array.
        /// </summary>
        /// <param name="str">The string to be converted to an array.</param>
        /// <returns></returns>
        /// This element was inserted by injac on machine PLATINCHECKER.
        /// 29.01.2011,20:54
        public static byte[] StringToByteArray(string str)
        {
            System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
            return enc.GetBytes(str);
        }

        /// <summary>
        /// Bytes the array to string.
        /// </summary>
        /// <param name="arr">The arrary to convert to a string.</param>
        /// <returns></returns>
        /// This element was inserted by injac on machine PLATINCHECKER.
        /// 29.01.2011,20:55
        public static string ByteArrayToString(byte[] arr)
        {
            System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
            return enc.GetString(arr);
        }
    }
}
